﻿using DataWasher.WebApi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DataWasher.WebApi.Common
{
    public static class HelpTool
    {
        public static YearMonthModel GetMonthsThisYear()
        {
            var yearModel = new YearMonthModel();
            yearModel.Months = new List<int>();
            var year = DateTime.Now.Year-1;
            yearModel.Year = year;
            var month = DateTime.Now.Month;
            for (int i = 1; i <= month; i++)
            {
                yearModel.Months.Add(i);
            }
            return yearModel;
        }
        public static YearMonthModel GetSomePeriod()
        {
            var yearModel = new YearMonthModel();
            yearModel.Months = new List<int>();
            var year = DateTime.Now.Year - 2;
            yearModel.Year = year;
            var month = DateTime.Now.Month;
            for (int i = 1; i <= month; i++)
            {
                yearModel.Months.Add(i);
            }
            return yearModel;
        }
    }
}
